import request from '@/utils/request'

// 添加图标
export function addOneIcon(data) {
  return request({
    url: '/Icon/insertSelective',
    method: 'POST',
    params: {
      iconName: data.iconName,
      iconUrl: data.iconUrl
    }
  })
}

// 删除图标
export function deleteOneIcon(iconId) {
  return request({
    url: 'Icon/deleteByPrimaryKey',
    method: 'POST',
    params: {
      iconId: iconId
    }
  })
}

// 修改图标
export function updateOneIcon(data) {
  return request({
    url: 'Icon/updateByPrimaryKeySelective',
    method: 'PUT',
    params: {
      iconId: data.iconId,
      iconName: data.iconName,
      iconUrl: data.iconUrl
    }
  })
}

// 获取所有图标
export function getAllIcons() {
  return request({
    url: 'Icon/selectAll',
    method: 'GET'
  })
}

// 获取单个图标
export function getOneIcons(iconId) {
  return request({
    url: 'Icon/selectById',
    method: 'GET',
    params: {
      iconId: iconId
    }
  })
}
